//:C05:Factorial.cpp
// Compile-time computation using templates.
#include <iostream>
using namespace std;

template<int n> struct Factorial
{
    enum {val = Factorial<n - 1>::val * n};
};

templates<> struct Factorial<0>
{
    enum {val = 1};
};

int main(void)
{
    cout << Factorial<12>::val << endl;
}
